package cn.jcby.app.lebu.controller;


import cn.jcby.app.lebu.controller.res.MyTagListRes;
import cn.jcby.app.lebu.service.UserTabService;
import cn.jcby.app.lebu.utils.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;


/**
 * 用户标签表
 *
 * @author lht
 * @email 
 * @date 2023-12-07 15:13:35
 */
@RestController
@RequestMapping("/tag")
@Api(tags="用户标签表")
public class UserTabController {
    @Autowired
    private UserTabService userTabService;

    /**
     * 列表
     */
    @PostMapping("/myList")
    @ApiOperation("个人标签列表")
    @ApiResponses({
          @ApiResponse(code = 200,message = "ok",response = MyTagListRes.class)
    })
    public Result list(){
        List<MyTagListRes> list = userTabService.myList();
        return Result.ok().put("data", list);
    }


    /**
     * 保存
     */
    @PostMapping("/addTags")
    @ApiOperation("保存标签")
    public Result addTags(@RequestBody List<String> tagCodeList){
        userTabService.addTags(tagCodeList);
        return Result.ok();
    }


}
